@model OpenAuth.IdentityServer.Quickstart.Device.DeviceAuthorizationViewModel

<div class="page-header">
    <div class="row page-header">
        <div class="col-sm-10">
            @if (Model.ClientLogoUrl != null)
            {
                <div class="client-logo"><img src="@Model.ClientLogoUrl"></div>
            }
            <h1>
                @Model.ClientName
                <small>is requesting your permission</small>
            </h1>
        </div>
    </div>

    @if (Model.ConfirmUserCode)
    {
        <div class="row">
            <div class="col-sm-8">
                <p>
                    Please confirm that the authorization request quotes the code: "@Model.UserCode".
                </p>
            </div>
        </div>
    }

    <div class="row">
        <div class="col-sm-8">
            <partial name="_ValidationSummary" />

            <form asp-action="Callback" class="consent-form">
                <input asp-for="UserCode" type="hidden" value="@Model.UserCode" />

                <div>Uncheck the permissions you do not wish to grant.</div>

                @if (Model.IdentityScopes.Any())
                {
                    <div class="panel panel-default consent-buttons">
                        <div class="panel-heading">
                            <span class="glyphicon glyphicon-user"></span>
                            Personal Information
                        </div>
                        <ul class="list-group">
                            @foreach (var scope in Model.IdentityScopes)
                            {
                                <partial name="_ScopeListItem" model="@scope" />
                            }
                        </ul>
                    </div>
                }

                @if (Model.ResourceScopes.Any())
                {
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <span class="glyphicon glyphicon-tasks"></span>
                            Application Access
                        </div>
                        <ul class="list-group">
                            @foreach (var scope in Model.ResourceScopes)
                            {
                                <partial name="_ScopeListItem" model="scope" />
                            }
                        </ul>
                    </div>
                }

                @if (Model.AllowRememberConsent)
                {
                    <div class="consent-remember">
                        <label>
                            <input class="consent-scopecheck" asp-for="RememberConsent" />
                            <strong>Remember My Decision</strong>
                        </label>
                    </div>
                }

                <div class="consent-buttons">
                    <button name="button" value="yes" class="btn btn-primary" autofocus>Yes, Allow</button>
                    <button name="button" value="no" class="btn">No, Do Not Allow</button>
                    @if (Model.ClientUrl != null)
                    {
                        <a class="pull-right btn btn-default" target="_blank" href="@Model.ClientUrl">
                            <span class="glyphicon glyphicon-info-sign"></span>
                            <strong>@Model.ClientName</strong>
                        </a>
                    }
                </div>
            </form>
        </div>
    </div>
</div>